package utility;

import world.Piece;


public class Color implements Cloneable{
	private String color;
	public static Color WHITE=new Color ("White");
	public static Color BLACK=new Color ("Black");
	public Color(String color) {
		super();
		this.color = color;
	}
	public String getColor() {
		return color;
	}
	public void setColor(String color) {
		this.color = color;
	}
	@Override
	public Object clone() {
		try {
		     Color p=(Color) super.clone();
		     return p;
		    }
		    catch(CloneNotSupportedException e) {
		    	e.printStackTrace();
		    	return null;
		    }
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((color == null) ? 0 : color.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Color other = (Color) obj;
		if (color == null) {
			if (other.color != null)
				return false;
		} else if (!color.equals(other.color))
			return false;
		return true;
	}
	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return color;
	}
	
}
